var aboutWindow = function() {
	var win = Titanium.UI.createWindow({  
	    title:'About',
	   	backgroundColor:'white'
	});
	win.backgroundColor = '#13386c';
	
	var fb = require('lib/fb');
	
	var loginButton = Ti.UI.createButton({
		title: 'Facebook login'
	});
	loginButton.addEventListener('click', function (e) {
		fb.login(nowLoggedIn);
	});
	
	var logoutButton = Ti.UI.createButton({
		title: 'logout'
	});
	
	logoutButton.addEventListener('click', function (e) {
		fb.logout(nowLoggedOut);
	});
	
	if (fb.isLoggedIn()) {
		win.add(logoutButton);
	} else {
		win.add(loginButton);
	}
	
	function nowLoggedIn (user) {
		win.remove(loginButton);
		win.add(logoutButton);
		
		// Do other stuff here
	}
	
	function nowLoggedOut () {
		win.remove(logoutButton);
		win.add(loginButton);
	}
	
	return win;
}

module.exports = aboutWindow;


// login button







